package com.cipe.cmrs.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import org.apache.commons.lang.builder.HashCodeBuilder;

@Embeddable
public class RestrictedUiElementsId implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 2043218304749429694L;

    @Column(name = "nameorvalue")
    private String nameorvalue;

    @Column(name = "roleid")
    private Integer roleId;

    public String getNameorvalue() {
        return nameorvalue;
    }

    public void setNameorvalue(String nameorvalue) {
        this.nameorvalue = nameorvalue;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public boolean equals(Object obj) {
        RestrictedUiElementsId target = (RestrictedUiElementsId) obj;
        return nameorvalue.equals(target.getNameorvalue()) && roleId.equals(target.getRoleId());
    }

    public int hashCode() {
        return new HashCodeBuilder().appendSuper(super.hashCode()).append(nameorvalue).append(roleId).toHashCode();
    }
}
